<?php
/**
 * @copyright meila.com
 * @author shaopu@
 * @name 生成筛选结果列表
 * @param
 *         $class = 分类ID
 *         $tag_ids =
 *         $p = 页码
 * @static
 *         PAGESIZE = 12        //12条数据一分页
 *
 *
 */
include_once '../../__global.php';
include_once(SERVER_ROOT_PATH.'/include/config/ml_actionCode.php');
class aj_save_userLike extends ml_controller{
    private $cid;
    private $aid;
    private $pid;
    private $uid;
    private $liketype;
    private $arrAlert = array(
        'cid' => 'cid',
        'aid' => 'aid',
        'pid' => 'pid',
        'liketype'=>'liketype',
        'usid'=>'uid',
        );

    public function initParam()
    {
        $this->cid = (int)$this->input('cid','P');
        $this->aid = (int)$this->input('aid','P');
        $this->uid = (int)$this->input('uid','P');
        $this->pid = (int)$this->input('pid','P');
        $this->liketype = $this->input('liketype','P');
    }
    function checkParam(){
        $this->check_referer();
        if(empty($this->cid))
            $this->api_output(ML_RCODE_PARAM , '', $this->arrAlert['cid']);
        if(empty($this->aid))
            $this->api_output(ML_RCODE_PARAM , '', $this->arrAlert['aid']);
        if(empty($this->pid))
            $this->api_output(ML_RCODE_PARAM , '', $this->arrAlert['pid']);
        if(empty($this->liketype))
            $this->api_output(ML_RCODE_PARAM , '', $this->arrAlert['liketype']);
    }
    public function main()
    {
        $usid = empty($this->uid) ? $_COOKIE['usid'] : $this->uid;

        if(empty($usid))
            $this->api_output(ML_RCODE_PARAM, '', $this->arrAlert('usid'));

        $logs = array($this->liketype, $this->cid, $this->aid, $this->pid);

        Tool_logger::baseActionLog($usid , ML_ACTCODE_LB_PHOTO_LIKE , $logs);
        if(true) {
            $this->api_output(ML_RCODE_SUCC);
        }else{
            $this->api_output(ML_RCODE_BUSY);
        }
    }
}
new aj_save_userLike();
?>